home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / share / emacs / 19.34 / lisp / version.el.z / version.el
Encoding:
Text File  |  1998-10-28  |  2.7 KB  |  80 lines

  1. ;;; version.el --- record version number of Emacs.
  2.  
  3. ;;; Copyright (C) 1985, 1992, 1994, 1995 Free Software Foundation, Inc.
  4.  
  5. ;; Maintainer: FSF
  6. ;; Keywords: internal
  7.  
  8. ;; This file is part of GNU Emacs.
  9.  
  10. ;; GNU Emacs is free software; you can redistribute it and/or modify
  11. ;; it under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; GNU Emacs is distributed in the hope that it will be useful,
  16. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. ;; GNU General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs; see the file COPYING.  If not, write to the
  22. ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23. ;; Boston, MA 02111-1307, USA.
  24.  
  25. ;;; Code:
  26.  
  27. (defconst emacs-version "19.34" "\
  28. Version numbers of this version of Emacs.")
  29.  
  30. (defconst emacs-major-version
  31.   (progn (string-match "^[0-9]+" emacs-version)
  32.      (string-to-int (match-string 0 emacs-version)))
  33.   "Major version number of this version of Emacs.
  34. This variable first existed in version 19.23.")
  35.  
  36. (defconst emacs-minor-version
  37.   (progn (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version)
  38.      (string-to-int (match-string 1 emacs-version)))
  39.   "Minor version number of this version of Emacs.
  40. This variable first existed in version 19.23.")
  41.  
  42. (defconst emacs-build-time (current-time) "\
  43. Time at which Emacs was dumped out.")
  44.  
  45. (defconst emacs-build-system (system-name))
  46.  
  47. (defun emacs-version  (&optional here) "\
  48. Return string describing the version of Emacs that is running.
  49. If optional argument HERE is non-nil, insert string at point.
  50. Don't use this function in programs to choose actions according
  51. to the system configuration; look at `system-configuration' instead."
  52.   (interactive "P")
  53.   (let ((version-string 
  54.          (format "GNU Emacs %s (%s%s) of %s on %s"
  55.                  emacs-version
  56.          system-configuration
  57.          (cond ((featurep 'motif) ", Motif")
  58.                ((featurep 'x-toolkit) ", X toolkit")
  59.                (t ""))
  60.          (format-time-string "%a %b %e %Y" emacs-build-time)
  61.                  emacs-build-system)))
  62.     (if here 
  63.         (insert version-string)
  64.       (if (interactive-p)
  65.           (message "%s" version-string)
  66.         version-string))))
  67.  
  68. ;;; We hope that this alias is easier for people to find.
  69. (defalias 'version 'emacs-version)
  70.  
  71. ;;; We put version info into the executable in the form that UNIX what(1) uses.
  72. (or (memq system-type '(vax-vms windows-nt ms-dos))
  73.     (purecopy (concat "\n@(#)" (emacs-version) "\n")))
  74.  
  75. ;;Local variables:
  76. ;;version-control: never
  77. ;;End:
  78.  
  79. ;;; version.el ends here
  80.